//
//  LVBaseViewModel.m
//  Base
//
//  Created by 曹连华 on 2019/3/13.
//  Copyright © 2019 曹连华. All rights reserved.
//

#import "LVBaseViewModel.h"

@interface LVBaseViewModel ()

@property (nonatomic, strong) NSString *requestVCName;

@end

@implementation LVBaseViewModel

- (instancetype)initWithVC:(UIViewController *)vc {
    self = [self init];
    if(self) {
        self.requestVCName = [NSString stringWithFormat:@"%p", &*vc];
    }
    return self;
}

- (instancetype)init {
    self = [super init];
    if (self) {
        [self initOperateBlock];
        [self resetDataSource];
    }
    return self;
}

- (void)showLoading {
    [self showLoadingWithMessage:nil];
}

- (void)showLoadingWithMessage:(nullable NSString *)message {
    if (self.showLoadingBlock) {
        self.showLoadingBlock(message?:@"");
    }
}

- (void)hideLoading {
    if (self.hideLoadingBlock) {
        self.hideLoadingBlock(@"");
    }
}

- (void)makeToastWithMessage:(nullable NSString *)message {
    if(self.makeToastBlock) {
        self.makeToastBlock(message?:@"");
    }
}

- (void)resetDataSource {
    
}

- (void)initOperateBlock {
    
}

- (void)didSelectedRowModelWithIndexPath:(NSIndexPath *)indexPath {
    
}

@end
